package com.ks.winterwarmimage.adapter;

import androidx.annotation.IntDef;

import com.ks.winterwarmimage.BaseActivity;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class DevItem {
    @IntDef({DeviceStatus.OFF_LINE,DeviceStatus.ON_LINE})
    @Retention(RetentionPolicy.SOURCE)
    public @interface DeviceStatus {
        /** 离线*/
        int OFF_LINE=0;
        /** 在线*/
        int ON_LINE=1;
    }
    /**设备id(MAC)*/
    public String deviceId;
    /**设备名称*/
    public String devName;
    /**亮度*/
    public byte brightness;
    /**继电器状态*/
    public byte relayState;
    /**温度控制继电器状态*/
    public boolean isTempControlRelay;
    /**
     * 状态
     * 0: 离线
     * 1: 在线
     */
    public @DeviceStatus int devStatus=DeviceStatus.OFF_LINE;
    /**温度*/
    public float temp;
    /**
     * 构造方法
     * @param devId 设备id
     * @param devName 设备名称
     */
    public DevItem(String devId, String devName){
        this(devId,devName,DeviceStatus.OFF_LINE,0);
    }
    /**
     * 构造方法
     * @param deviceId 设备id
     * @param devName 设备名称
     * @param devStatus 设备状态.限制在{@link DeviceStatus}范围
     * @param temp 设备温度
     */
    public DevItem(String deviceId, String devName, @DeviceStatus int devStatus, float temp){
        this.deviceId = deviceId;
        this.devName = devName;
        this.devStatus = devStatus;
        this.temp = temp;
    }
}
